#include "precompiled.h"
#include "loadchardialog.h"
using namespace weo::ui;
void LoadCharDialog::on_LoadCharFromFileButton_clicked()
{
    QString fileName = QFileDialog::getOpenFileName(this, tr("Open Equipment"), "", tr("XML Files (*.xml)"));
    m_Url  = fileName.toStdString();
    m_FileMode = true;
    if(!m_Url.empty())
    {
        this->done(QDialog::Accepted);
    }
}
LoadCharDialog::LoadCharDialog(QWidget* parent /*= 0*/, Qt::WFlags flags /*= 0*/) : QDialog(parent, flags)
{
    setupUi(this);
    m_FileMode = false;
}
std::string LoadCharDialog::GetUrl() const
{
    if(LoadCharEditBox->text().size() > 0 || !m_FileMode)
    {
        return LoadCharEditBox->text().toStdString();
    }
    else return m_Url;
}